package com.zhiyou100.entity;

/**
 * 老师工厂类
 *
 * @author yang
 * @className FactoryInstanceStudent
 * @packageName com.zhiyou100.entity
 * @Description TODO 老师工厂类
 * @date 2020-08-18 21:16
 */
public class FactoryInstanceTeacher {
    /**
     * 静态工厂方法，直接 类名.方法 就能创建一个 Teacher 对象
     *
     * @return Teacher
     */
    public static Teacher instanceTeacher2() {
        return new Teacher(1, "静态工厂");
    }

    /**
     * 实例工厂方法，创建工厂对象后才能通过 对象.instanceStudent1 创建一个 Teacher 对象
     *
     * @return Teacher
     */
    public Teacher instanceTeacher1() {
        return new Teacher(2, "实例工厂");
    }
}
